import request from '@/utils/request'

// 获取部门列表
export const getDeptListAPI = () => {
  return request({
    method: 'get',
    url: '/company/department'
  })
}

// 删除部门
export const delDeptAPI = (id) => {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}

// 获取负责人列表
export const getManagerAPI = () => {
  return request({
    method: 'get',
    url: '/sys/user/simple'
  })
}

// 新增部门
export const addDeptAPI = (deptForm) => {
  return request({
    method: 'post',
    url: '/company/department',
    data: deptForm
  })
}

// 根据id获取部门详情
export const getDeptIdAPI = (id) => {
  return request({
    method: 'get',
    url: `/company/department/${id}`
  })
}

// 编辑部门
export const editDeptAPI = (deptForm) => {
  return request({
    method: 'put',
    url: `/company/department/${deptForm.id}`,
    data: deptForm
  })
}
